package com.innovation.wjrpc.rpc;

import com.innovation.wjrpc.codec.Decoder;
import com.innovation.wjrpc.codec.Encoder;
import com.innovation.wjrpc.codec.impl.JSONDecoder;
import com.innovation.wjrpc.codec.impl.JSONEncoder;
import com.innovation.wjrpc.loader.TransportSelector;
import com.innovation.wjrpc.loader.impl.RandomTransportSelector;
import com.innovation.wjrpc.protocol.Peer;
import com.innovation.wjrpc.transport.TransportClient;
import com.innovation.wjrpc.communication.HTTPTransportClient;
import lombok.Data;

import java.util.Arrays;
import java.util.List;

/**
 * @author innoyiya
 * @date 2021/9/7 19:31
 */
@Data
public class RpcClientConfig {

    private Class<? extends TransportClient> transportClass = HTTPTransportClient.class;

    private Class<? extends Encoder> encoderClass = JSONEncoder.class;

    private Class<? extends Decoder> decoderClass = JSONDecoder.class;

    private Class<? extends TransportSelector> selectorClass = RandomTransportSelector.class;

    private int connectCount = 1;

    private List<Peer> servers = Arrays.asList(new Peer("127.0.0.1", 3000));
}

